package com.challenge.smsdao.majormanage.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.challenge.smsbase.Domain.BaseEntity;

import javax.persistence.*;
import java.util.List;

/**
 * luhongyu
 */
@Entity
public class Academy extends BaseEntity<Long> {
    @Column
    private String name;

    @JsonIgnoreProperties("academy")
    @OneToMany(mappedBy = "academy",cascade = {CascadeType.REMOVE,CascadeType.REFRESH},fetch = FetchType.LAZY)
    private List<Major> majors;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Major> getMajors() {
        return majors;
    }

    public void setMajors(List<Major> majors) {
        this.majors = majors;
    }
}
